<?php

namespace plugin\tmadmin\app\controller;

use support\Cache;
use support\Request;
use Tinywan\Jwt\JwtToken;

class TestController
{

    public function index()
    {

        $user = [
            'id'  => 2022, // 这里必须是一个全局抽象唯一id
            'name'  => 'Tinywan',
            'email' => 'Tinywan@163.com'
        ];
        Cache::set('adminUser', $user);
        return json(Cache::get('adminUser'));
    }

    public function jwt(Request $request)
    {
        $uid = JwtToken::getCurrentId();
        return json(['uid'=>$uid]);

    }



}
